From 19b9451ce786877830b47dd5e3ac2b641d6b3f7d Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 15 Jun 2005 21:22:54 +0000 Subject: [PATCH] Get red and blue in place. 2005-06-15 Matthias Clasen * gdk/x11/gdkcursor-x11.c (gdk_cursor_get_image): Get red and blue in place. --- ChangeLog | 3 +++ ChangeLog.pre-2-10 | 3 +++ ChangeLog.pre-2-8 | 3 +++ gdk/x11/gdkcursor-x11.c | 9 ++++++++- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 38c5322849..646f1fa4a5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2005-06-15 Matthias Clasen + * gdk/x11/gdkcursor-x11.c (gdk_cursor_get_image): Get + red and blue in place. + * gtk/gtkwindow.c (gtk_window_parse_geometry): Fox doc formatting, pointed out by Kjartan Maraas. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 38c5322849..646f1fa4a5 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,8 @@ 2005-06-15 Matthias Clasen + * gdk/x11/gdkcursor-x11.c (gdk_cursor_get_image): Get + red and blue in place. + * gtk/gtkwindow.c (gtk_window_parse_geometry): Fox doc formatting, pointed out by Kjartan Maraas. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 38c5322849..646f1fa4a5 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,5 +1,8 @@ 2005-06-15 Matthias Clasen + * gdk/x11/gdkcursor-x11.c (gdk_cursor_get_image): Get + red and blue in place. + * gtk/gtkwindow.c (gtk_window_parse_geometry): Fox doc formatting, pointed out by Kjartan Maraas. diff --git a/gdk/x11/gdkcursor-x11.c b/gdk/x11/gdkcursor-x11.c index 69a2b49892..33609daf6a 100644 --- a/gdk/x11/gdkcursor-x11.c +++ b/gdk/x11/gdkcursor-x11.c @@ -337,7 +337,7 @@ gdk_cursor_get_image (GdkCursor *cursor) XcursorImage *image; gint size; gchar buf[32]; - guchar *data; + guchar *data, *p, tmp; GdkPixbuf *pixbuf; gchar *theme; @@ -366,6 +366,13 @@ gdk_cursor_get_image (GdkCursor *cursor) data = g_malloc (4 * image->width * image->height); memcpy (data, image->pixels, 4 * image->width * image->height); + for (p = data; p < data + (4 * image->width * image->height); p += 4) + { + tmp = p[0]; + p[0] = p[2]; + p[2] = tmp; + } + pixbuf = gdk_pixbuf_new_from_data (data, GDK_COLORSPACE_RGB, TRUE, 8, image->width, image->height, 4 * image->width, -- 2.30.2